<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>条件渲染</title>
</head>

<body>
    <div id="app">
        <p v-if="ok">成功了</p>
        <p v-else>失败了</p>
        <p v-show="ok">表白成功</p>
        <p v-show="!ok">表白失败</p>
        <button @click="ok=!ok">切换</button>
    </div>
    <script src="https://cdn.bootcss.com/vue/2.5.16/vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                ok: false
            }
        })
    </script>
</body>

</html>